package com.mzw.project.controller;


import com.mzw.project.common.BaseResponse;
import com.mzw.project.service.VoucherOrderService;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author L1nAn
 * @since 2021-12-22
 */
@RestController
@RequestMapping("/voucher-order")
public class VoucherOrderController {

    @Resource
    private VoucherOrderService voucherOrderService;

    @PostMapping("/seckill/{id}")
    public BaseResponse<Long> seckillVoucher(@PathVariable("id") Long voucherId, HttpServletRequest request) {
        return voucherOrderService.seckillCoucher(voucherId, request);
    }
}
